
_shutdown：     文件格式 elf32-i386


Disassembly of section .text:

00000000 <main>:

extern int shutdown();

int
main(int argc, char *argv[])
{
   0:	55                   	push   %ebp
   1:	89 e5                	mov    %esp,%ebp
   3:	83 e4 f0             	and    $0xfffffff0,%esp
  shutdown();
   6:	e8 fc 02 00 00       	call   307 <shutdown>
  exit();
   b:	e8 57 02 00 00       	call   267 <exit>

00000010 <stosb>:
               "cc");
}

static inline void
stosb(void *addr, int data, int cnt)
{
  10:	55                   	push   %ebp
  11:	89 e5                	mov    %esp,%ebp
  13:	57                   	push   %edi
  14:	53                   	push   %ebx
  asm volatile("cld; rep stosb" :
  15:	8b 4d 08             	mov    0x8(%ebp),%ecx
  18:	8b 55 10             	mov    0x10(%ebp),%edx
  1b:	8b 45 0c             	mov    0xc(%ebp),%eax
  1e:	89 cb                	mov    %ecx,%ebx
  20:	89 df                	mov    %ebx,%edi
  22:	89 d1                	mov    %edx,%ecx
  24:	fc                   	cld    
  25:	f3 aa                	rep stos %al,%es:(%edi)
  27:	89 ca                	mov    %ecx,%edx
  29:	89 fb                	mov    %edi,%ebx
  2b:	89 5d 08             	mov    %ebx,0x8(%ebp)
  2e:	89 55 10             	mov    %edx,0x10(%ebp)
               "=D" (addr), "=c" (cnt) :
               "0" (addr), "1" (cnt), "a" (data) :
               "memory", "cc");
}
  31:	90                   	nop
  32:	5b                   	pop    %ebx
  33:	5f                   	pop    %edi
  34:	5d                   	pop    %ebp
  35:	c3                   	ret    

00000036 <strcpy>:
#include "user.h"
#include "x86.h"

char*
strcpy(char *s, char *t)
{
  36:	55                   	push   %ebp
  37:	89 e5                	mov    %esp,%ebp
  39:	83 ec 10             	sub    $0x10,%esp
  char *os;

  os = s;
  3c:	8b 45 08             	mov    0x8(%ebp),%eax
  3f:	89 45 fc             	mov    %eax,-0x4(%ebp)
  while((*s++ = *t++) != 0)
  42:	90                   	nop
  43:	8b 55 0c             	mov    0xc(%ebp),%edx
  46:	8d 42 01             	lea    0x1(%edx),%eax
  49:	89 45 0c             	mov    %eax,0xc(%ebp)
  4c:	8b 45 08             	mov    0x8(%ebp),%eax
  4f:	8d 48 01             	lea    0x1(%eax),%ecx
  52:	89 4d 08             	mov    %ecx,0x8(%ebp)
  55:	0f b6 12             	movzbl (%edx),%edx
  58:	88 10                	mov    %dl,(%eax)
  5a:	0f b6 00             	movzbl (%eax),%eax
  5d:	84 c0                	test   %al,%al
  5f:	75 e2                	jne    43 <strcpy+0xd>
    ;
  return os;
  61:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  64:	c9                   	leave  
  65:	c3                   	ret    

00000066 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  66:	55                   	push   %ebp
  67:	89 e5                	mov    %esp,%ebp
  while(*p && *p == *q)
  69:	eb 08                	jmp    73 <strcmp+0xd>
    p++, q++;
  6b:	83 45 08 01          	addl   $0x1,0x8(%ebp)
  6f:	83 45 0c 01          	addl   $0x1,0xc(%ebp)
  while(*p && *p == *q)
  73:	8b 45 08             	mov    0x8(%ebp),%eax
  76:	0f b6 00             	movzbl (%eax),%eax
  79:	84 c0                	test   %al,%al
  7b:	74 10                	je     8d <strcmp+0x27>
  7d:	8b 45 08             	mov    0x8(%ebp),%eax
  80:	0f b6 10             	movzbl (%eax),%edx
  83:	8b 45 0c             	mov    0xc(%ebp),%eax
  86:	0f b6 00             	movzbl (%eax),%eax
  89:	38 c2                	cmp    %al,%dl
  8b:	74 de                	je     6b <strcmp+0x5>
  return (uchar)*p - (uchar)*q;
  8d:	8b 45 08             	mov    0x8(%ebp),%eax
  90:	0f b6 00             	movzbl (%eax),%eax
  93:	0f b6 d0             	movzbl %al,%edx
  96:	8b 45 0c             	mov    0xc(%ebp),%eax
  99:	0f b6 00             	movzbl (%eax),%eax
  9c:	0f b6 c8             	movzbl %al,%ecx
  9f:	89 d0                	mov    %edx,%eax
  a1:	29 c8                	sub    %ecx,%eax
}
  a3:	5d                   	pop    %ebp
  a4:	c3                   	ret    

000000a5 <strlen>:

uint
strlen(char *s)
{
  a5:	55                   	push   %ebp
  a6:	89 e5                	mov    %esp,%ebp
  a8:	83 ec 10             	sub    $0x10,%esp
  int n;

  for(n = 0; s[n]; n++)
  ab:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  b2:	eb 04                	jmp    b8 <strlen+0x13>
  b4:	83 45 fc 01          	addl   $0x1,-0x4(%ebp)
  b8:	8b 55 fc             	mov    -0x4(%ebp),%edx
  bb:	8b 45 08             	mov    0x8(%ebp),%eax
  be:	01 d0                	add    %edx,%eax
  c0:	0f b6 00             	movzbl (%eax),%eax
  c3:	84 c0                	test   %al,%al
  c5:	75 ed                	jne    b4 <strlen+0xf>
    ;
  return n;
  c7:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
  ca:	c9                   	leave  
  cb:	c3                   	ret    

000000cc <memset>:

void*
memset(void *dst, int c, uint n)
{
  cc:	55                   	push   %ebp
  cd:	89 e5                	mov    %esp,%ebp
  stosb(dst, c, n);
  cf:	8b 45 10             	mov    0x10(%ebp),%eax
  d2:	50                   	push   %eax
  d3:	ff 75 0c             	push   0xc(%ebp)
  d6:	ff 75 08             	push   0x8(%ebp)
  d9:	e8 32 ff ff ff       	call   10 <stosb>
  de:	83 c4 0c             	add    $0xc,%esp
  return dst;
  e1:	8b 45 08             	mov    0x8(%ebp),%eax
}
  e4:	c9                   	leave  
  e5:	c3                   	ret    

000000e6 <strchr>:

char*
strchr(const char *s, char c)
{
  e6:	55                   	push   %ebp
  e7:	89 e5                	mov    %esp,%ebp
  e9:	83 ec 04             	sub    $0x4,%esp
  ec:	8b 45 0c             	mov    0xc(%ebp),%eax
  ef:	88 45 fc             	mov    %al,-0x4(%ebp)
  for(; *s; s++)
  f2:	eb 14                	jmp    108 <strchr+0x22>
    if(*s == c)
  f4:	8b 45 08             	mov    0x8(%ebp),%eax
  f7:	0f b6 00             	movzbl (%eax),%eax
  fa:	38 45 fc             	cmp    %al,-0x4(%ebp)
  fd:	75 05                	jne    104 <strchr+0x1e>
      return (char*)s;
  ff:	8b 45 08             	mov    0x8(%ebp),%eax
 102:	eb 13                	jmp    117 <strchr+0x31>
  for(; *s; s++)
 104:	83 45 08 01          	addl   $0x1,0x8(%ebp)
 108:	8b 45 08             	mov    0x8(%ebp),%eax
 10b:	0f b6 00             	movzbl (%eax),%eax
 10e:	84 c0                	test   %al,%al
 110:	75 e2                	jne    f4 <strchr+0xe>
  return 0;
 112:	b8 00 00 00 00       	mov    $0x0,%eax
}
 117:	c9                   	leave  
 118:	c3                   	ret    

00000119 <gets>:

char*
gets(char *buf, int max)
{
 119:	55                   	push   %ebp
 11a:	89 e5                	mov    %esp,%ebp
 11c:	83 ec 18             	sub    $0x18,%esp
  int i, cc;
  char c;

  for(i=0; i+1 < max; ){
 11f:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
 126:	eb 42                	jmp    16a <gets+0x51>
    cc = read(0, &c, 1);
 128:	83 ec 04             	sub    $0x4,%esp
 12b:	6a 01                	push   $0x1
 12d:	8d 45 ef             	lea    -0x11(%ebp),%eax
 130:	50                   	push   %eax
 131:	6a 00                	push   $0x0
 133:	e8 47 01 00 00       	call   27f <read>
 138:	83 c4 10             	add    $0x10,%esp
 13b:	89 45 f0             	mov    %eax,-0x10(%ebp)
    if(cc < 1)
 13e:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 142:	7e 33                	jle    177 <gets+0x5e>
      break;
    buf[i++] = c;
 144:	8b 45 f4             	mov    -0xc(%ebp),%eax
 147:	8d 50 01             	lea    0x1(%eax),%edx
 14a:	89 55 f4             	mov    %edx,-0xc(%ebp)
 14d:	89 c2                	mov    %eax,%edx
 14f:	8b 45 08             	mov    0x8(%ebp),%eax
 152:	01 c2                	add    %eax,%edx
 154:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 158:	88 02                	mov    %al,(%edx)
    if(c == '\n' || c == '\r')
 15a:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 15e:	3c 0a                	cmp    $0xa,%al
 160:	74 16                	je     178 <gets+0x5f>
 162:	0f b6 45 ef          	movzbl -0x11(%ebp),%eax
 166:	3c 0d                	cmp    $0xd,%al
 168:	74 0e                	je     178 <gets+0x5f>
  for(i=0; i+1 < max; ){
 16a:	8b 45 f4             	mov    -0xc(%ebp),%eax
 16d:	83 c0 01             	add    $0x1,%eax
 170:	39 45 0c             	cmp    %eax,0xc(%ebp)
 173:	7f b3                	jg     128 <gets+0xf>
 175:	eb 01                	jmp    178 <gets+0x5f>
      break;
 177:	90                   	nop
      break;
  }
  buf[i] = '\0';
 178:	8b 55 f4             	mov    -0xc(%ebp),%edx
 17b:	8b 45 08             	mov    0x8(%ebp),%eax
 17e:	01 d0                	add    %edx,%eax
 180:	c6 00 00             	movb   $0x0,(%eax)
  return buf;
 183:	8b 45 08             	mov    0x8(%ebp),%eax
}
 186:	c9                   	leave  
 187:	c3                   	ret    

00000188 <stat>:

int
stat(char *n, struct stat *st)
{
 188:	55                   	push   %ebp
 189:	89 e5                	mov    %esp,%ebp
 18b:	83 ec 18             	sub    $0x18,%esp
  int fd;
  int r;

  fd = open(n, O_RDONLY);
 18e:	83 ec 08             	sub    $0x8,%esp
 191:	6a 00                	push   $0x0
 193:	ff 75 08             	push   0x8(%ebp)
 196:	e8 0c 01 00 00       	call   2a7 <open>
 19b:	83 c4 10             	add    $0x10,%esp
 19e:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(fd < 0)
 1a1:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 1a5:	79 07                	jns    1ae <stat+0x26>
    return -1;
 1a7:	b8 ff ff ff ff       	mov    $0xffffffff,%eax
 1ac:	eb 25                	jmp    1d3 <stat+0x4b>
  r = fstat(fd, st);
 1ae:	83 ec 08             	sub    $0x8,%esp
 1b1:	ff 75 0c             	push   0xc(%ebp)
 1b4:	ff 75 f4             	push   -0xc(%ebp)
 1b7:	e8 03 01 00 00       	call   2bf <fstat>
 1bc:	83 c4 10             	add    $0x10,%esp
 1bf:	89 45 f0             	mov    %eax,-0x10(%ebp)
  close(fd);
 1c2:	83 ec 0c             	sub    $0xc,%esp
 1c5:	ff 75 f4             	push   -0xc(%ebp)
 1c8:	e8 c2 00 00 00       	call   28f <close>
 1cd:	83 c4 10             	add    $0x10,%esp
  return r;
 1d0:	8b 45 f0             	mov    -0x10(%ebp),%eax
}
 1d3:	c9                   	leave  
 1d4:	c3                   	ret    

000001d5 <atoi>:

int
atoi(const char *s)
{
 1d5:	55                   	push   %ebp
 1d6:	89 e5                	mov    %esp,%ebp
 1d8:	83 ec 10             	sub    $0x10,%esp
  int n;

  n = 0;
 1db:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%ebp)
  while('0' <= *s && *s <= '9')
 1e2:	eb 25                	jmp    209 <atoi+0x34>
    n = n*10 + *s++ - '0';
 1e4:	8b 55 fc             	mov    -0x4(%ebp),%edx
 1e7:	89 d0                	mov    %edx,%eax
 1e9:	c1 e0 02             	shl    $0x2,%eax
 1ec:	01 d0                	add    %edx,%eax
 1ee:	01 c0                	add    %eax,%eax
 1f0:	89 c1                	mov    %eax,%ecx
 1f2:	8b 45 08             	mov    0x8(%ebp),%eax
 1f5:	8d 50 01             	lea    0x1(%eax),%edx
 1f8:	89 55 08             	mov    %edx,0x8(%ebp)
 1fb:	0f b6 00             	movzbl (%eax),%eax
 1fe:	0f be c0             	movsbl %al,%eax
 201:	01 c8                	add    %ecx,%eax
 203:	83 e8 30             	sub    $0x30,%eax
 206:	89 45 fc             	mov    %eax,-0x4(%ebp)
  while('0' <= *s && *s <= '9')
 209:	8b 45 08             	mov    0x8(%ebp),%eax
 20c:	0f b6 00             	movzbl (%eax),%eax
 20f:	3c 2f                	cmp    $0x2f,%al
 211:	7e 0a                	jle    21d <atoi+0x48>
 213:	8b 45 08             	mov    0x8(%ebp),%eax
 216:	0f b6 00             	movzbl (%eax),%eax
 219:	3c 39                	cmp    $0x39,%al
 21b:	7e c7                	jle    1e4 <atoi+0xf>
  return n;
 21d:	8b 45 fc             	mov    -0x4(%ebp),%eax
}
 220:	c9                   	leave  
 221:	c3                   	ret    

00000222 <memmove>:

void*
memmove(void *vdst, void *vsrc, int n)
{
 222:	55                   	push   %ebp
 223:	89 e5                	mov    %esp,%ebp
 225:	83 ec 10             	sub    $0x10,%esp
  char *dst, *src;

  dst = vdst;
 228:	8b 45 08             	mov    0x8(%ebp),%eax
 22b:	89 45 fc             	mov    %eax,-0x4(%ebp)
  src = vsrc;
 22e:	8b 45 0c             	mov    0xc(%ebp),%eax
 231:	89 45 f8             	mov    %eax,-0x8(%ebp)
  while(n-- > 0)
 234:	eb 17                	jmp    24d <memmove+0x2b>
    *dst++ = *src++;
 236:	8b 55 f8             	mov    -0x8(%ebp),%edx
 239:	8d 42 01             	lea    0x1(%edx),%eax
 23c:	89 45 f8             	mov    %eax,-0x8(%ebp)
 23f:	8b 45 fc             	mov    -0x4(%ebp),%eax
 242:	8d 48 01             	lea    0x1(%eax),%ecx
 245:	89 4d fc             	mov    %ecx,-0x4(%ebp)
 248:	0f b6 12             	movzbl (%edx),%edx
 24b:	88 10                	mov    %dl,(%eax)
  while(n-- > 0)
 24d:	8b 45 10             	mov    0x10(%ebp),%eax
 250:	8d 50 ff             	lea    -0x1(%eax),%edx
 253:	89 55 10             	mov    %edx,0x10(%ebp)
 256:	85 c0                	test   %eax,%eax
 258:	7f dc                	jg     236 <memmove+0x14>
  return vdst;
 25a:	8b 45 08             	mov    0x8(%ebp),%eax
}
 25d:	c9                   	leave  
 25e:	c3                   	ret    

0000025f <fork>:
  name: \
    movl $SYS_ ## name, %eax; \
    int $T_SYSCALL; \
    ret

SYSCALL(fork)
 25f:	b8 01 00 00 00       	mov    $0x1,%eax
 264:	cd 40                	int    $0x40
 266:	c3                   	ret    

00000267 <exit>:
SYSCALL(exit)
 267:	b8 02 00 00 00       	mov    $0x2,%eax
 26c:	cd 40                	int    $0x40
 26e:	c3                   	ret    

0000026f <wait>:
SYSCALL(wait)
 26f:	b8 03 00 00 00       	mov    $0x3,%eax
 274:	cd 40                	int    $0x40
 276:	c3                   	ret    

00000277 <pipe>:
SYSCALL(pipe)
 277:	b8 04 00 00 00       	mov    $0x4,%eax
 27c:	cd 40                	int    $0x40
 27e:	c3                   	ret    

0000027f <read>:
SYSCALL(read)
 27f:	b8 05 00 00 00       	mov    $0x5,%eax
 284:	cd 40                	int    $0x40
 286:	c3                   	ret    

00000287 <write>:
SYSCALL(write)
 287:	b8 10 00 00 00       	mov    $0x10,%eax
 28c:	cd 40                	int    $0x40
 28e:	c3                   	ret    

0000028f <close>:
SYSCALL(close)
 28f:	b8 15 00 00 00       	mov    $0x15,%eax
 294:	cd 40                	int    $0x40
 296:	c3                   	ret    

00000297 <kill>:
SYSCALL(kill)
 297:	b8 06 00 00 00       	mov    $0x6,%eax
 29c:	cd 40                	int    $0x40
 29e:	c3                   	ret    

0000029f <exec>:
SYSCALL(exec)
 29f:	b8 07 00 00 00       	mov    $0x7,%eax
 2a4:	cd 40                	int    $0x40
 2a6:	c3                   	ret    

000002a7 <open>:
SYSCALL(open)
 2a7:	b8 0f 00 00 00       	mov    $0xf,%eax
 2ac:	cd 40                	int    $0x40
 2ae:	c3                   	ret    

000002af <mknod>:
SYSCALL(mknod)
 2af:	b8 11 00 00 00       	mov    $0x11,%eax
 2b4:	cd 40                	int    $0x40
 2b6:	c3                   	ret    

000002b7 <unlink>:
SYSCALL(unlink)
 2b7:	b8 12 00 00 00       	mov    $0x12,%eax
 2bc:	cd 40                	int    $0x40
 2be:	c3                   	ret    

000002bf <fstat>:
SYSCALL(fstat)
 2bf:	b8 08 00 00 00       	mov    $0x8,%eax
 2c4:	cd 40                	int    $0x40
 2c6:	c3                   	ret    

000002c7 <link>:
SYSCALL(link)
 2c7:	b8 13 00 00 00       	mov    $0x13,%eax
 2cc:	cd 40                	int    $0x40
 2ce:	c3                   	ret    

000002cf <mkdir>:
SYSCALL(mkdir)
 2cf:	b8 14 00 00 00       	mov    $0x14,%eax
 2d4:	cd 40                	int    $0x40
 2d6:	c3                   	ret    

000002d7 <chdir>:
SYSCALL(chdir)
 2d7:	b8 09 00 00 00       	mov    $0x9,%eax
 2dc:	cd 40                	int    $0x40
 2de:	c3                   	ret    

000002df <dup>:
SYSCALL(dup)
 2df:	b8 0a 00 00 00       	mov    $0xa,%eax
 2e4:	cd 40                	int    $0x40
 2e6:	c3                   	ret    

000002e7 <getpid>:
SYSCALL(getpid)
 2e7:	b8 0b 00 00 00       	mov    $0xb,%eax
 2ec:	cd 40                	int    $0x40
 2ee:	c3                   	ret    

000002ef <sbrk>:
SYSCALL(sbrk)
 2ef:	b8 0c 00 00 00       	mov    $0xc,%eax
 2f4:	cd 40                	int    $0x40
 2f6:	c3                   	ret    

000002f7 <sleep>:
SYSCALL(sleep)
 2f7:	b8 0d 00 00 00       	mov    $0xd,%eax
 2fc:	cd 40                	int    $0x40
 2fe:	c3                   	ret    

000002ff <uptime>:
SYSCALL(uptime)
 2ff:	b8 0e 00 00 00       	mov    $0xe,%eax
 304:	cd 40                	int    $0x40
 306:	c3                   	ret    

00000307 <shutdown>:
SYSCALL(shutdown)
 307:	b8 16 00 00 00       	mov    $0x16,%eax
 30c:	cd 40                	int    $0x40
 30e:	c3                   	ret    

0000030f <get_free_frame_cnt>:
SYSCALL(get_free_frame_cnt)
 30f:	b8 17 00 00 00       	mov    $0x17,%eax
 314:	cd 40                	int    $0x40
 316:	c3                   	ret    

00000317 <putc>:
#include "stat.h"
#include "user.h"

static void
putc(int fd, char c)
{
 317:	55                   	push   %ebp
 318:	89 e5                	mov    %esp,%ebp
 31a:	83 ec 18             	sub    $0x18,%esp
 31d:	8b 45 0c             	mov    0xc(%ebp),%eax
 320:	88 45 f4             	mov    %al,-0xc(%ebp)
  write(fd, &c, 1);
 323:	83 ec 04             	sub    $0x4,%esp
 326:	6a 01                	push   $0x1
 328:	8d 45 f4             	lea    -0xc(%ebp),%eax
 32b:	50                   	push   %eax
 32c:	ff 75 08             	push   0x8(%ebp)
 32f:	e8 53 ff ff ff       	call   287 <write>
 334:	83 c4 10             	add    $0x10,%esp
}
 337:	90                   	nop
 338:	c9                   	leave  
 339:	c3                   	ret    

0000033a <printint>:

static void
printint(int fd, int xx, int base, int sgn)
{
 33a:	55                   	push   %ebp
 33b:	89 e5                	mov    %esp,%ebp
 33d:	83 ec 28             	sub    $0x28,%esp
  static char digits[] = "0123456789ABCDEF";
  char buf[16];
  int i, neg;
  uint x;

  neg = 0;
 340:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
  if(sgn && xx < 0){
 347:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
 34b:	74 17                	je     364 <printint+0x2a>
 34d:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
 351:	79 11                	jns    364 <printint+0x2a>
    neg = 1;
 353:	c7 45 f0 01 00 00 00 	movl   $0x1,-0x10(%ebp)
    x = -xx;
 35a:	8b 45 0c             	mov    0xc(%ebp),%eax
 35d:	f7 d8                	neg    %eax
 35f:	89 45 ec             	mov    %eax,-0x14(%ebp)
 362:	eb 06                	jmp    36a <printint+0x30>
  } else {
    x = xx;
 364:	8b 45 0c             	mov    0xc(%ebp),%eax
 367:	89 45 ec             	mov    %eax,-0x14(%ebp)
  }

  i = 0;
 36a:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)
  do{
    buf[i++] = digits[x % base];
 371:	8b 4d 10             	mov    0x10(%ebp),%ecx
 374:	8b 45 ec             	mov    -0x14(%ebp),%eax
 377:	ba 00 00 00 00       	mov    $0x0,%edx
 37c:	f7 f1                	div    %ecx
 37e:	89 d1                	mov    %edx,%ecx
 380:	8b 45 f4             	mov    -0xc(%ebp),%eax
 383:	8d 50 01             	lea    0x1(%eax),%edx
 386:	89 55 f4             	mov    %edx,-0xc(%ebp)
 389:	0f b6 91 e8 09 00 00 	movzbl 0x9e8(%ecx),%edx
 390:	88 54 05 dc          	mov    %dl,-0x24(%ebp,%eax,1)
  }while((x /= base) != 0);
 394:	8b 4d 10             	mov    0x10(%ebp),%ecx
 397:	8b 45 ec             	mov    -0x14(%ebp),%eax
 39a:	ba 00 00 00 00       	mov    $0x0,%edx
 39f:	f7 f1                	div    %ecx
 3a1:	89 45 ec             	mov    %eax,-0x14(%ebp)
 3a4:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 3a8:	75 c7                	jne    371 <printint+0x37>
  if(neg)
 3aa:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 3ae:	74 2d                	je     3dd <printint+0xa3>
    buf[i++] = '-';
 3b0:	8b 45 f4             	mov    -0xc(%ebp),%eax
 3b3:	8d 50 01             	lea    0x1(%eax),%edx
 3b6:	89 55 f4             	mov    %edx,-0xc(%ebp)
 3b9:	c6 44 05 dc 2d       	movb   $0x2d,-0x24(%ebp,%eax,1)

  while(--i >= 0)
 3be:	eb 1d                	jmp    3dd <printint+0xa3>
    putc(fd, buf[i]);
 3c0:	8d 55 dc             	lea    -0x24(%ebp),%edx
 3c3:	8b 45 f4             	mov    -0xc(%ebp),%eax
 3c6:	01 d0                	add    %edx,%eax
 3c8:	0f b6 00             	movzbl (%eax),%eax
 3cb:	0f be c0             	movsbl %al,%eax
 3ce:	83 ec 08             	sub    $0x8,%esp
 3d1:	50                   	push   %eax
 3d2:	ff 75 08             	push   0x8(%ebp)
 3d5:	e8 3d ff ff ff       	call   317 <putc>
 3da:	83 c4 10             	add    $0x10,%esp
  while(--i >= 0)
 3dd:	83 6d f4 01          	subl   $0x1,-0xc(%ebp)
 3e1:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 3e5:	79 d9                	jns    3c0 <printint+0x86>
}
 3e7:	90                   	nop
 3e8:	90                   	nop
 3e9:	c9                   	leave  
 3ea:	c3                   	ret    

000003eb <printf>:

// Print to the given fd. Only understands %d, %x, %p, %s.
void
printf(int fd, char *fmt, ...)
{
 3eb:	55                   	push   %ebp
 3ec:	89 e5                	mov    %esp,%ebp
 3ee:	83 ec 28             	sub    $0x28,%esp
  char *s;
  int c, i, state;
  uint *ap;

  state = 0;
 3f1:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  ap = (uint*)(void*)&fmt + 1;
 3f8:	8d 45 0c             	lea    0xc(%ebp),%eax
 3fb:	83 c0 04             	add    $0x4,%eax
 3fe:	89 45 e8             	mov    %eax,-0x18(%ebp)
  for(i = 0; fmt[i]; i++){
 401:	c7 45 f0 00 00 00 00 	movl   $0x0,-0x10(%ebp)
 408:	e9 59 01 00 00       	jmp    566 <printf+0x17b>
    c = fmt[i] & 0xff;
 40d:	8b 55 0c             	mov    0xc(%ebp),%edx
 410:	8b 45 f0             	mov    -0x10(%ebp),%eax
 413:	01 d0                	add    %edx,%eax
 415:	0f b6 00             	movzbl (%eax),%eax
 418:	0f be c0             	movsbl %al,%eax
 41b:	25 ff 00 00 00       	and    $0xff,%eax
 420:	89 45 e4             	mov    %eax,-0x1c(%ebp)
    if(state == 0){
 423:	83 7d ec 00          	cmpl   $0x0,-0x14(%ebp)
 427:	75 2c                	jne    455 <printf+0x6a>
      if(c == '%'){
 429:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 42d:	75 0c                	jne    43b <printf+0x50>
        state = '%';
 42f:	c7 45 ec 25 00 00 00 	movl   $0x25,-0x14(%ebp)
 436:	e9 27 01 00 00       	jmp    562 <printf+0x177>
      } else {
        putc(fd, c);
 43b:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 43e:	0f be c0             	movsbl %al,%eax
 441:	83 ec 08             	sub    $0x8,%esp
 444:	50                   	push   %eax
 445:	ff 75 08             	push   0x8(%ebp)
 448:	e8 ca fe ff ff       	call   317 <putc>
 44d:	83 c4 10             	add    $0x10,%esp
 450:	e9 0d 01 00 00       	jmp    562 <printf+0x177>
      }
    } else if(state == '%'){
 455:	83 7d ec 25          	cmpl   $0x25,-0x14(%ebp)
 459:	0f 85 03 01 00 00    	jne    562 <printf+0x177>
      if(c == 'd'){
 45f:	83 7d e4 64          	cmpl   $0x64,-0x1c(%ebp)
 463:	75 1e                	jne    483 <printf+0x98>
        printint(fd, *ap, 10, 1);
 465:	8b 45 e8             	mov    -0x18(%ebp),%eax
 468:	8b 00                	mov    (%eax),%eax
 46a:	6a 01                	push   $0x1
 46c:	6a 0a                	push   $0xa
 46e:	50                   	push   %eax
 46f:	ff 75 08             	push   0x8(%ebp)
 472:	e8 c3 fe ff ff       	call   33a <printint>
 477:	83 c4 10             	add    $0x10,%esp
        ap++;
 47a:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 47e:	e9 d8 00 00 00       	jmp    55b <printf+0x170>
      } else if(c == 'x' || c == 'p'){
 483:	83 7d e4 78          	cmpl   $0x78,-0x1c(%ebp)
 487:	74 06                	je     48f <printf+0xa4>
 489:	83 7d e4 70          	cmpl   $0x70,-0x1c(%ebp)
 48d:	75 1e                	jne    4ad <printf+0xc2>
        printint(fd, *ap, 16, 0);
 48f:	8b 45 e8             	mov    -0x18(%ebp),%eax
 492:	8b 00                	mov    (%eax),%eax
 494:	6a 00                	push   $0x0
 496:	6a 10                	push   $0x10
 498:	50                   	push   %eax
 499:	ff 75 08             	push   0x8(%ebp)
 49c:	e8 99 fe ff ff       	call   33a <printint>
 4a1:	83 c4 10             	add    $0x10,%esp
        ap++;
 4a4:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 4a8:	e9 ae 00 00 00       	jmp    55b <printf+0x170>
      } else if(c == 's'){
 4ad:	83 7d e4 73          	cmpl   $0x73,-0x1c(%ebp)
 4b1:	75 43                	jne    4f6 <printf+0x10b>
        s = (char*)*ap;
 4b3:	8b 45 e8             	mov    -0x18(%ebp),%eax
 4b6:	8b 00                	mov    (%eax),%eax
 4b8:	89 45 f4             	mov    %eax,-0xc(%ebp)
        ap++;
 4bb:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
        if(s == 0)
 4bf:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 4c3:	75 25                	jne    4ea <printf+0xff>
          s = "(null)";
 4c5:	c7 45 f4 a2 07 00 00 	movl   $0x7a2,-0xc(%ebp)
        while(*s != 0){
 4cc:	eb 1c                	jmp    4ea <printf+0xff>
          putc(fd, *s);
 4ce:	8b 45 f4             	mov    -0xc(%ebp),%eax
 4d1:	0f b6 00             	movzbl (%eax),%eax
 4d4:	0f be c0             	movsbl %al,%eax
 4d7:	83 ec 08             	sub    $0x8,%esp
 4da:	50                   	push   %eax
 4db:	ff 75 08             	push   0x8(%ebp)
 4de:	e8 34 fe ff ff       	call   317 <putc>
 4e3:	83 c4 10             	add    $0x10,%esp
          s++;
 4e6:	83 45 f4 01          	addl   $0x1,-0xc(%ebp)
        while(*s != 0){
 4ea:	8b 45 f4             	mov    -0xc(%ebp),%eax
 4ed:	0f b6 00             	movzbl (%eax),%eax
 4f0:	84 c0                	test   %al,%al
 4f2:	75 da                	jne    4ce <printf+0xe3>
 4f4:	eb 65                	jmp    55b <printf+0x170>
        }
      } else if(c == 'c'){
 4f6:	83 7d e4 63          	cmpl   $0x63,-0x1c(%ebp)
 4fa:	75 1d                	jne    519 <printf+0x12e>
        putc(fd, *ap);
 4fc:	8b 45 e8             	mov    -0x18(%ebp),%eax
 4ff:	8b 00                	mov    (%eax),%eax
 501:	0f be c0             	movsbl %al,%eax
 504:	83 ec 08             	sub    $0x8,%esp
 507:	50                   	push   %eax
 508:	ff 75 08             	push   0x8(%ebp)
 50b:	e8 07 fe ff ff       	call   317 <putc>
 510:	83 c4 10             	add    $0x10,%esp
        ap++;
 513:	83 45 e8 04          	addl   $0x4,-0x18(%ebp)
 517:	eb 42                	jmp    55b <printf+0x170>
      } else if(c == '%'){
 519:	83 7d e4 25          	cmpl   $0x25,-0x1c(%ebp)
 51d:	75 17                	jne    536 <printf+0x14b>
        putc(fd, c);
 51f:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 522:	0f be c0             	movsbl %al,%eax
 525:	83 ec 08             	sub    $0x8,%esp
 528:	50                   	push   %eax
 529:	ff 75 08             	push   0x8(%ebp)
 52c:	e8 e6 fd ff ff       	call   317 <putc>
 531:	83 c4 10             	add    $0x10,%esp
 534:	eb 25                	jmp    55b <printf+0x170>
      } else {
        // Unknown % sequence.  Print it to draw attention.
        putc(fd, '%');
 536:	83 ec 08             	sub    $0x8,%esp
 539:	6a 25                	push   $0x25
 53b:	ff 75 08             	push   0x8(%ebp)
 53e:	e8 d4 fd ff ff       	call   317 <putc>
 543:	83 c4 10             	add    $0x10,%esp
        putc(fd, c);
 546:	8b 45 e4             	mov    -0x1c(%ebp),%eax
 549:	0f be c0             	movsbl %al,%eax
 54c:	83 ec 08             	sub    $0x8,%esp
 54f:	50                   	push   %eax
 550:	ff 75 08             	push   0x8(%ebp)
 553:	e8 bf fd ff ff       	call   317 <putc>
 558:	83 c4 10             	add    $0x10,%esp
      }
      state = 0;
 55b:	c7 45 ec 00 00 00 00 	movl   $0x0,-0x14(%ebp)
  for(i = 0; fmt[i]; i++){
 562:	83 45 f0 01          	addl   $0x1,-0x10(%ebp)
 566:	8b 55 0c             	mov    0xc(%ebp),%edx
 569:	8b 45 f0             	mov    -0x10(%ebp),%eax
 56c:	01 d0                	add    %edx,%eax
 56e:	0f b6 00             	movzbl (%eax),%eax
 571:	84 c0                	test   %al,%al
 573:	0f 85 94 fe ff ff    	jne    40d <printf+0x22>
    }
  }
}
 579:	90                   	nop
 57a:	90                   	nop
 57b:	c9                   	leave  
 57c:	c3                   	ret    

0000057d <free>:
static Header base;
static Header *freep;

void
free(void *ap)
{
 57d:	55                   	push   %ebp
 57e:	89 e5                	mov    %esp,%ebp
 580:	83 ec 10             	sub    $0x10,%esp
  Header *bp, *p;

  bp = (Header*)ap - 1;
 583:	8b 45 08             	mov    0x8(%ebp),%eax
 586:	83 e8 08             	sub    $0x8,%eax
 589:	89 45 f8             	mov    %eax,-0x8(%ebp)
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 58c:	a1 04 0a 00 00       	mov    0xa04,%eax
 591:	89 45 fc             	mov    %eax,-0x4(%ebp)
 594:	eb 24                	jmp    5ba <free+0x3d>
    if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))
 596:	8b 45 fc             	mov    -0x4(%ebp),%eax
 599:	8b 00                	mov    (%eax),%eax
 59b:	39 45 fc             	cmp    %eax,-0x4(%ebp)
 59e:	72 12                	jb     5b2 <free+0x35>
 5a0:	8b 45 f8             	mov    -0x8(%ebp),%eax
 5a3:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 5a6:	77 24                	ja     5cc <free+0x4f>
 5a8:	8b 45 fc             	mov    -0x4(%ebp),%eax
 5ab:	8b 00                	mov    (%eax),%eax
 5ad:	39 45 f8             	cmp    %eax,-0x8(%ebp)
 5b0:	72 1a                	jb     5cc <free+0x4f>
  for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)
 5b2:	8b 45 fc             	mov    -0x4(%ebp),%eax
 5b5:	8b 00                	mov    (%eax),%eax
 5b7:	89 45 fc             	mov    %eax,-0x4(%ebp)
 5ba:	8b 45 f8             	mov    -0x8(%ebp),%eax
 5bd:	3b 45 fc             	cmp    -0x4(%ebp),%eax
 5c0:	76 d4                	jbe    596 <free+0x19>
 5c2:	8b 45 fc             	mov    -0x4(%ebp),%eax
 5c5:	8b 00                	mov    (%eax),%eax
 5c7:	39 45 f8             	cmp    %eax,-0x8(%ebp)
 5ca:	73 ca                	jae    596 <free+0x19>
      break;
  if(bp + bp->s.size == p->s.ptr){
 5cc:	8b 45 f8             	mov    -0x8(%ebp),%eax
 5cf:	8b 40 04             	mov    0x4(%eax),%eax
 5d2:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
 5d9:	8b 45 f8             	mov    -0x8(%ebp),%eax
 5dc:	01 c2                	add    %eax,%edx
 5de:	8b 45 fc             	mov    -0x4(%ebp),%eax
 5e1:	8b 00                	mov    (%eax),%eax
 5e3:	39 c2                	cmp    %eax,%edx
 5e5:	75 24                	jne    60b <free+0x8e>
    bp->s.size += p->s.ptr->s.size;
 5e7:	8b 45 f8             	mov    -0x8(%ebp),%eax
 5ea:	8b 50 04             	mov    0x4(%eax),%edx
 5ed:	8b 45 fc             	mov    -0x4(%ebp),%eax
 5f0:	8b 00                	mov    (%eax),%eax
 5f2:	8b 40 04             	mov    0x4(%eax),%eax
 5f5:	01 c2                	add    %eax,%edx
 5f7:	8b 45 f8             	mov    -0x8(%ebp),%eax
 5fa:	89 50 04             	mov    %edx,0x4(%eax)
    bp->s.ptr = p->s.ptr->s.ptr;
 5fd:	8b 45 fc             	mov    -0x4(%ebp),%eax
 600:	8b 00                	mov    (%eax),%eax
 602:	8b 10                	mov    (%eax),%edx
 604:	8b 45 f8             	mov    -0x8(%ebp),%eax
 607:	89 10                	mov    %edx,(%eax)
 609:	eb 0a                	jmp    615 <free+0x98>
  } else
    bp->s.ptr = p->s.ptr;
 60b:	8b 45 fc             	mov    -0x4(%ebp),%eax
 60e:	8b 10                	mov    (%eax),%edx
 610:	8b 45 f8             	mov    -0x8(%ebp),%eax
 613:	89 10                	mov    %edx,(%eax)
  if(p + p->s.size == bp){
 615:	8b 45 fc             	mov    -0x4(%ebp),%eax
 618:	8b 40 04             	mov    0x4(%eax),%eax
 61b:	8d 14 c5 00 00 00 00 	lea    0x0(,%eax,8),%edx
 622:	8b 45 fc             	mov    -0x4(%ebp),%eax
 625:	01 d0                	add    %edx,%eax
 627:	39 45 f8             	cmp    %eax,-0x8(%ebp)
 62a:	75 20                	jne    64c <free+0xcf>
    p->s.size += bp->s.size;
 62c:	8b 45 fc             	mov    -0x4(%ebp),%eax
 62f:	8b 50 04             	mov    0x4(%eax),%edx
 632:	8b 45 f8             	mov    -0x8(%ebp),%eax
 635:	8b 40 04             	mov    0x4(%eax),%eax
 638:	01 c2                	add    %eax,%edx
 63a:	8b 45 fc             	mov    -0x4(%ebp),%eax
 63d:	89 50 04             	mov    %edx,0x4(%eax)
    p->s.ptr = bp->s.ptr;
 640:	8b 45 f8             	mov    -0x8(%ebp),%eax
 643:	8b 10                	mov    (%eax),%edx
 645:	8b 45 fc             	mov    -0x4(%ebp),%eax
 648:	89 10                	mov    %edx,(%eax)
 64a:	eb 08                	jmp    654 <free+0xd7>
  } else
    p->s.ptr = bp;
 64c:	8b 45 fc             	mov    -0x4(%ebp),%eax
 64f:	8b 55 f8             	mov    -0x8(%ebp),%edx
 652:	89 10                	mov    %edx,(%eax)
  freep = p;
 654:	8b 45 fc             	mov    -0x4(%ebp),%eax
 657:	a3 04 0a 00 00       	mov    %eax,0xa04
}
 65c:	90                   	nop
 65d:	c9                   	leave  
 65e:	c3                   	ret    

0000065f <morecore>:

static Header*
morecore(uint nu)
{
 65f:	55                   	push   %ebp
 660:	89 e5                	mov    %esp,%ebp
 662:	83 ec 18             	sub    $0x18,%esp
  char *p;
  Header *hp;

  if(nu < 4096)
 665:	81 7d 08 ff 0f 00 00 	cmpl   $0xfff,0x8(%ebp)
 66c:	77 07                	ja     675 <morecore+0x16>
    nu = 4096;
 66e:	c7 45 08 00 10 00 00 	movl   $0x1000,0x8(%ebp)
  p = sbrk(nu * sizeof(Header));
 675:	8b 45 08             	mov    0x8(%ebp),%eax
 678:	c1 e0 03             	shl    $0x3,%eax
 67b:	83 ec 0c             	sub    $0xc,%esp
 67e:	50                   	push   %eax
 67f:	e8 6b fc ff ff       	call   2ef <sbrk>
 684:	83 c4 10             	add    $0x10,%esp
 687:	89 45 f4             	mov    %eax,-0xc(%ebp)
  if(p == (char*)-1)
 68a:	83 7d f4 ff          	cmpl   $0xffffffff,-0xc(%ebp)
 68e:	75 07                	jne    697 <morecore+0x38>
    return 0;
 690:	b8 00 00 00 00       	mov    $0x0,%eax
 695:	eb 26                	jmp    6bd <morecore+0x5e>
  hp = (Header*)p;
 697:	8b 45 f4             	mov    -0xc(%ebp),%eax
 69a:	89 45 f0             	mov    %eax,-0x10(%ebp)
  hp->s.size = nu;
 69d:	8b 45 f0             	mov    -0x10(%ebp),%eax
 6a0:	8b 55 08             	mov    0x8(%ebp),%edx
 6a3:	89 50 04             	mov    %edx,0x4(%eax)
  free((void*)(hp + 1));
 6a6:	8b 45 f0             	mov    -0x10(%ebp),%eax
 6a9:	83 c0 08             	add    $0x8,%eax
 6ac:	83 ec 0c             	sub    $0xc,%esp
 6af:	50                   	push   %eax
 6b0:	e8 c8 fe ff ff       	call   57d <free>
 6b5:	83 c4 10             	add    $0x10,%esp
  return freep;
 6b8:	a1 04 0a 00 00       	mov    0xa04,%eax
}
 6bd:	c9                   	leave  
 6be:	c3                   	ret    

000006bf <malloc>:

void*
malloc(uint nbytes)
{
 6bf:	55                   	push   %ebp
 6c0:	89 e5                	mov    %esp,%ebp
 6c2:	83 ec 18             	sub    $0x18,%esp
  Header *p, *prevp;
  uint nunits;

  nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;
 6c5:	8b 45 08             	mov    0x8(%ebp),%eax
 6c8:	83 c0 07             	add    $0x7,%eax
 6cb:	c1 e8 03             	shr    $0x3,%eax
 6ce:	83 c0 01             	add    $0x1,%eax
 6d1:	89 45 ec             	mov    %eax,-0x14(%ebp)
  if((prevp = freep) == 0){
 6d4:	a1 04 0a 00 00       	mov    0xa04,%eax
 6d9:	89 45 f0             	mov    %eax,-0x10(%ebp)
 6dc:	83 7d f0 00          	cmpl   $0x0,-0x10(%ebp)
 6e0:	75 23                	jne    705 <malloc+0x46>
    base.s.ptr = freep = prevp = &base;
 6e2:	c7 45 f0 fc 09 00 00 	movl   $0x9fc,-0x10(%ebp)
 6e9:	8b 45 f0             	mov    -0x10(%ebp),%eax
 6ec:	a3 04 0a 00 00       	mov    %eax,0xa04
 6f1:	a1 04 0a 00 00       	mov    0xa04,%eax
 6f6:	a3 fc 09 00 00       	mov    %eax,0x9fc
    base.s.size = 0;
 6fb:	c7 05 00 0a 00 00 00 	movl   $0x0,0xa00
 702:	00 00 00 
  }
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 705:	8b 45 f0             	mov    -0x10(%ebp),%eax
 708:	8b 00                	mov    (%eax),%eax
 70a:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if(p->s.size >= nunits){
 70d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 710:	8b 40 04             	mov    0x4(%eax),%eax
 713:	39 45 ec             	cmp    %eax,-0x14(%ebp)
 716:	77 4d                	ja     765 <malloc+0xa6>
      if(p->s.size == nunits)
 718:	8b 45 f4             	mov    -0xc(%ebp),%eax
 71b:	8b 40 04             	mov    0x4(%eax),%eax
 71e:	39 45 ec             	cmp    %eax,-0x14(%ebp)
 721:	75 0c                	jne    72f <malloc+0x70>
        prevp->s.ptr = p->s.ptr;
 723:	8b 45 f4             	mov    -0xc(%ebp),%eax
 726:	8b 10                	mov    (%eax),%edx
 728:	8b 45 f0             	mov    -0x10(%ebp),%eax
 72b:	89 10                	mov    %edx,(%eax)
 72d:	eb 26                	jmp    755 <malloc+0x96>
      else {
        p->s.size -= nunits;
 72f:	8b 45 f4             	mov    -0xc(%ebp),%eax
 732:	8b 40 04             	mov    0x4(%eax),%eax
 735:	2b 45 ec             	sub    -0x14(%ebp),%eax
 738:	89 c2                	mov    %eax,%edx
 73a:	8b 45 f4             	mov    -0xc(%ebp),%eax
 73d:	89 50 04             	mov    %edx,0x4(%eax)
        p += p->s.size;
 740:	8b 45 f4             	mov    -0xc(%ebp),%eax
 743:	8b 40 04             	mov    0x4(%eax),%eax
 746:	c1 e0 03             	shl    $0x3,%eax
 749:	01 45 f4             	add    %eax,-0xc(%ebp)
        p->s.size = nunits;
 74c:	8b 45 f4             	mov    -0xc(%ebp),%eax
 74f:	8b 55 ec             	mov    -0x14(%ebp),%edx
 752:	89 50 04             	mov    %edx,0x4(%eax)
      }
      freep = prevp;
 755:	8b 45 f0             	mov    -0x10(%ebp),%eax
 758:	a3 04 0a 00 00       	mov    %eax,0xa04
      return (void*)(p + 1);
 75d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 760:	83 c0 08             	add    $0x8,%eax
 763:	eb 3b                	jmp    7a0 <malloc+0xe1>
    }
    if(p == freep)
 765:	a1 04 0a 00 00       	mov    0xa04,%eax
 76a:	39 45 f4             	cmp    %eax,-0xc(%ebp)
 76d:	75 1e                	jne    78d <malloc+0xce>
      if((p = morecore(nunits)) == 0)
 76f:	83 ec 0c             	sub    $0xc,%esp
 772:	ff 75 ec             	push   -0x14(%ebp)
 775:	e8 e5 fe ff ff       	call   65f <morecore>
 77a:	83 c4 10             	add    $0x10,%esp
 77d:	89 45 f4             	mov    %eax,-0xc(%ebp)
 780:	83 7d f4 00          	cmpl   $0x0,-0xc(%ebp)
 784:	75 07                	jne    78d <malloc+0xce>
        return 0;
 786:	b8 00 00 00 00       	mov    $0x0,%eax
 78b:	eb 13                	jmp    7a0 <malloc+0xe1>
  for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){
 78d:	8b 45 f4             	mov    -0xc(%ebp),%eax
 790:	89 45 f0             	mov    %eax,-0x10(%ebp)
 793:	8b 45 f4             	mov    -0xc(%ebp),%eax
 796:	8b 00                	mov    (%eax),%eax
 798:	89 45 f4             	mov    %eax,-0xc(%ebp)
    if(p->s.size >= nunits){
 79b:	e9 6d ff ff ff       	jmp    70d <malloc+0x4e>
  }
}
 7a0:	c9                   	leave  
 7a1:	c3                   	ret    
